home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
TEXTGETP.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
3KB
|
84 lines
/************************************************************************************/
/* TextGetProc */
/************************************************************************************/
#include "MyHeaders.h"
int TextGetProc ()
{
int TGRetCode = 0;
WorkRetCode = NextSubAndPosit(&nextTextPosit); /* get a windSub and position */
if (WorkRetCode != 0) /* if subscript not available */
{
PlaceAlert(131); /* load and position the alert */
StopAlert (131, NIL); /* display it with stop icon */
TGRetCode = 1; /* kiss it off */
goto ENDING;
}
windTbl[windSub].windPtr = /* point to data area */
(WindowPtr) &windTbl[windSub].windRec;
if (useColor)
windTbl[windSub].windPtr = /* get color template */
GetNewCWindow (129, windTbl[windSub].windPtr, (WindowPtr) -1);
else
windTbl[windSub].windPtr = /* get the template */
GetNewWindow (129, windTbl[windSub].windPtr, (WindowPtr) -1);
windTbl[windSub].windRec.refCon = ProcText; /* save window type */
windTbl[windSub].windPathRefNum = 0; /* clear path ref number */
windTbl[windSub].windTEChanged = FALSE; /* no data changed yet */
/* position window on desktop */
MoveWindow (windTbl[windSub].windPtr, nextTextPosit.h, nextTextPosit.v, TRUE);
SetPort (&windTbl[windSub].windRec.port); /* set this as the grafPort */
TextFont(geneva); /* choose the font... */
TextFace(NIL); /* ... style, and.. */
TextSize(12); /* ... size */
workRect = windTbl[windSub].windRec.port.portRect;
viewRect = workRect;
viewRect.right -= 16;
viewRect.top += 4;
viewRect.bottom -= 16;
destRect = viewRect;
destRect.right -= 6;
destRect.left += 6;
windTbl[windSub].windTEH[0] =
TENew (&destRect, &viewRect); /* create TE Record */
SetClikLoop ((ProcPtr) myClikLoop, /* install click loop */
windTbl[windSub].windTEH[0]);
TEAutoView (TRUE, windTbl[windSub].windTEH[0]); /* enable AutoScroll */
TESetSelect (0,0, windTbl[windSub].windTEH[0]); /* caret to top */
windTbl[windSub].windTEHCount = 1; /* one TE field is defined */
windTbl[windSub].windTEHSub = 0; /* go to first TE area */
workRect = windTbl[windSub].windRec.port.portRect;
windTbl[windSub].windCntlH[0] = /* get the control */
GetNewControl (128, windTbl[windSub].windPtr);
SetCtlAction (windTbl[windSub].windCntlH[0], /* install own action */
(ProcPtr) myActionProc);
SizeControl (windTbl[windSub].windCntlH[0], 16, /* size to fit window */
workRect.bottom - workRect.top + 2 - 15);
MoveControl (windTbl[windSub].windCntlH[0], /* move onto window */
workRect.right - 15, workRect.top - 1);
ShowControl (windTbl[windSub].windCntlH[0]); /* make it visible */
windTbl[windSub].windCntlHCount = 1; /* one Control is defined */
windTbl[windSub].windCntlHSub = 0; /* go to first Control */
ShowWindow (windTbl[windSub].windPtr);
InvalRect (&windTbl[windSub].windRec.port.portRect); /* request redraw */
ENDING:
return TGRetCode;
}